import Vue from "vue";
import Router from "vue-router";

import login from "../views/login";
import Home from "../views/home";
import Share from "../views/share";
import Mine from "../views/mine";
import Findloan from "../views/findloan";
import Register from "../views/login/register";
import Details from "../views/details";
Vue.use(Router);

export default new Router({
  mode: "history",
  base:  process.env.NODE_ENV === 'production'
      ? '/loan/'
      : '/',
  routes: [
    {
      path: "/login",
      component: login
    },
    {
      path: "/register",
      component: Register
    },
    {
      path: "/details",
      component: Details
    },
    {
      path: "/home",
      name: "home",
      component: Home
    },
    {
      path: "/share",
      name: "share",
      component: Share
    },
    {
      path: "/findloan",
      name: "findloan",
      component: Findloan
    },
    {
      path: "/mine",
      name: "mine",
      component: Mine
    }
  ]
});
